//---------------------------------------------------------------------
//
// Author: jachymko
//
// Description: Base class used by PingHostCommand to send pings.
//
// Creation date: Dec 14, 2006
//
//---------------------------------------------------------------------
using System;
using System.Net;
using System.Collections.Generic;

namespace Pscx.Commands.Net
{
    abstract partial class PingExecutor : IDisposable
    {
        readonly PingHostCommand command;
        readonly StatisticCounter stats = new StatisticCounter();

        protected PingExecutor(PingHostCommand command)
        {
            this.command = command;
        }

        internal PingHostCommand Command
        {
            get { return command; }
        }

        internal StatisticCounter Statistics
        {
            get { return stats; }
        }

        public abstract void Dispose();

        internal abstract void Send(IPAddress address);
        internal abstract void Send(IPHostEntry host);
        internal abstract void Send(string hostOrAddress);

        internal abstract void WriteInfo(PingHostInfo info);
        internal abstract void WriteStatistics(PingTaskBase task);
        
        internal virtual void BeginProcessing() { } 
        internal virtual void EndProcessing() { }
        internal virtual void StopProcessing() { }

    }
}
